package cn.knight.controller;

import cn.knight.domain.User;
import lombok.extern.java.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserCtrl {

    @Value("${server.port}")
    private Long port;

    @GetMapping("/user/{id}")
    public User getById(@PathVariable Long id){
        return User.builder().id(1L).username("蒙多").desc("想去哪就去哪,port = " + port).build();
    }
}
